#include "writeKNXCtrlCmd.h"


writeKNXCtrlCmd::writeKNXCtrlCmd(QObject *parent) :
    BaseCmd(parent)
{
    this->m_protocolType = ProtocolType::SWKNXProtol;
    this->m_functionCode = FunctionCode;
}

void writeKNXCtrlCmd::unPackage(Package package)
{

}
Package writeKNXCtrlCmd::toPackage()
{
    Package package;
    QByteArray body;

    body.append(m_groupAddress>>8);
    body.append(m_groupAddress&0xff);
    body.append(m_knxLen);
    body.append(m_dataList);

    package.setFunction(FunctionCode);
    package.setBody(body);

    return package;
}

quint16 writeKNXCtrlCmd::groupAddress()
{
    return m_groupAddress;
}
quint8 writeKNXCtrlCmd::knxLen()
 {
    return m_knxLen;
}
QByteArray writeKNXCtrlCmd::dataList()
{
    return m_dataList;
}


void writeKNXCtrlCmd::setGroupAddress(quint16 groupAddress)
{
    m_groupAddress = groupAddress;
}
void writeKNXCtrlCmd::setKnxLen(quint8 len)
{
    m_knxLen = len;
}
void writeKNXCtrlCmd::setDataList(QByteArray dataList)
{
    m_dataList = dataList;
 }
